import 'package:get/get.dart';
import 'package:logger/logger.dart';
import 'package:smart_devices/service/login.dart';
import 'package:smart_devices/service/shared_preference.dart';
import 'package:smart_devices/utils/loading.dart';

import 'env_config.dart';

/// 全局的服务
class Global {
  /// 初始化一些全局服务
  static Future<void> init() async {
    Get.putAsync<SharedPreferenceService>(() => SharedPreferenceService().init());

    /// 日志
    Logger.level = EnvConfig.isRelease ? Level.info : Level.trace;
    Loading();
    Get.put<LoginService>(LoginService());
  }
}
